home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / biblio / bibtex / utils / bibextract / citefind.sh < prev    next >
Linux/UNIX/POSIX Shell Script  |  1992-10-29  |  3KB  |  77 lines

  1. #!/bin/sh
  2. ### ====================================================================
  3. ###  @UNIX-shell-file{
  4. ###     author          = "Nelson H. F. Beebe",
  5. ###     version         = "1.02",
  6. ###     date            = "30 October 1992",
  7. ###     time            = "19:43:51 MST",
  8. ###     filename        = "citefind.sh",
  9. ###     address         = "Center for Scientific Computing
  10. ###                        Department of Mathematics
  11. ###                        University of Utah
  12. ###                        Salt Lake City, UT 84112
  13. ###                        USA",
  14. ###     telephone       = "+1 801 581 5254",
  15. ###     FAX             = "+1 801 581 4148",
  16. ###     checksum        = "17317 76 327 3239",
  17. ###     email           = "beebe@math.utah.edu (Internet)",
  18. ###     codetable       = "ISO/ASCII",
  19. ###     keywords        = "BibTeX, bibliography",
  20. ###     supported       = "yes",
  21. ###     docstring       = "*********************************************
  22. ###                        This code is hereby placed in the PUBLIC
  23. ###                        DOMAIN and may be redistributed without any
  24. ###                        restrictions.
  25. ###                        *********************************************
  26. ###
  27. ###                        Read a list of cite tags from the file
  28. ###                        given by the first argument, then process
  29. ###                        each of the remaining file arguments as
  30. ###                        BibTeX bib files, looking up the
  31. ###                        bibentries, and output them to stdout.
  32. ###                        @preamble{} and @string{} entries are
  33. ###                        automatically output as well.
  34. ###
  35. ###                        Usage:
  36. ###                             citefind foo.tags bibfile(s) >newbibfile
  37. ###                        or
  38. ###                             citefind - bibfile(s) >newbibfile
  39. ###
  40. ###                        To be recognized, bib entries must look like
  41. ###
  42. ###                        @keyword{tag,
  43. ###                        ...
  44. ###                        }
  45. ###
  46. ###                        where the start @ appears in column 1, and
  47. ###                        the complete entry has balanced braces.
  48. ###
  49. ###                        The checksum field above contains a CRC-16
  50. ###                        checksum as the first value, followed by the
  51. ###                        equivalent of the standard UNIX wc (word
  52. ###                        count) utility output of lines, words, and
  53. ###                        characters.  This is produced by Robert
  54. ###                        Solovay's checksum utility.",
  55. ###  }
  56. ### ====================================================================
  57.  
  58. ### Edit history (reverse chronological order):
  59.  
  60. ### [21-Oct-1992]       1.01    Update for public distribution
  61. ### [21-Oct-1992]       1.00    Original version.
  62.  
  63. LIBDIR=@LIBDIR@
  64.  
  65. if [ "xx$1" = "xx-" ]         # make a temporary copy of stdin
  66. then
  67.         INPUTFILE=/tmp/citefind.$$
  68.         trap '/bin/rm -f ${INPUTFILE}' 2 1
  69.         cat >${INPUTFILE}
  70.         shift
  71.         nawk -f ${LIBDIR}/citefind.awk $*
  72.         /bin/rm -f ${INPUTFILE}
  73. else
  74.         nawk -f ${LIBDIR}/citefind.awk $*
  75. fi
  76. ### ====================================================================
  77.